import { createRouter, createWebHashHistory } from 'vue-router'

import Home from '@/views/home/Home'
import List from '@/views/list/List'
import Details from '@/views/details/Details'

import Cookbook from '@/views/home/cookbook/Cookbook'
import Category from '@/views/home/category/Category'
import Map from '@/views/home/map/Map'
import More from '@/views/home/more/More'

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    redirect: '/home/cookbook',
    children: [
      {
        path: 'cookbook',
        component: Cookbook
      },
      {
        path: 'category',
        component: Category
      },
      {
        path: 'map',
        component: Map
      },
      {
        path: 'more',
        component: More
      }
    ]
  },
  {
    path: '/list',
    component: List
  },
  {
    path: '/details',
    component: Details
  }
]

const router = createRouter({
  routes,
  history: createWebHashHistory()
})

export default router

